package com.sz.biz.app.web.api;

import com.sz.common.base.dto.ResultDto;
import com.sz.common.core.service.PrincipalUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * Function: 获取上下文信息描述 <br>
 * Author: Charles <br>
 * Date: 2016-11-02 10:47:00
 */
@RestController
@RequestMapping("/api/v1")
@Api(description = " ", tags = "000、版本说明")
public class Context {

    @RequestMapping(value = "/context", method = {RequestMethod.GET})
    @ApiOperation(value = "上下文", notes = "上下文")
    public ResultDto context() {
        String userName = PrincipalUtils.getAccountName();
        Map<String, String> map = new HashMap<>();
        map.put("username", userName);
        ResultDto result = new ResultDto(map);
        return result;
    }
}
